import request from '@/utils/request'

// 查询成绩列表
export function listExamResult(query) {
  return request({
    url: '/exam/examResult/list',
    method: 'get',
    params: query
  })
}

// 查询成绩详细
export function getExamResult(id) {
  return request({
    url: '/exam/examResult/' + id,
    method: 'get'
  })
}

// 新增成绩
export function addExamResult(data) {
  return request({
    url: '/exam/examResult',
    method: 'post',
    data: data
  })
}

// 修改成绩
export function updateExamResult(data) {
  return request({
    url: '/exam/examResult',
    method: 'put',
    data: data
  })
}

// 删除成绩
export function delExamResult(id) {
  return request({
    url: '/exam/examResult/' + id,
    method: 'delete'
  })
}

// 导出成绩
export function exportExamResult(query) {
  return request({
    url: '/exam/examResult/export',
    method: 'get',
    params: query
  })
}

// 导出学生名单
export function exportExamStudent(taskId) {
  return request({
    url: '/exam/examResult/export/'+taskId,
    method: 'get'
  })
}

// 查询学生名单
export function listExamStudent(taskId) {
  return request({
    url: '/exam/examResult/students/'+taskId,
    method: 'get'
  })
}

// 保存成绩
export function saveExamStudent(data) {
  return request({
    url: '/exam/examResult/save',
    method: 'post',
    data: data
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/exam/examResult/importTemplate',
    method: 'get'
  })
}